import { createRouter, createWebHashHistory } from "vue-router";
import HomeView from "../views/HomeView.vue";

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),

  routes: [
    {
      path: "/home",
      name: "home",
      component: HomeView,
    },
    {
      // 修正路由配置，避免 '/about' 路由和子路由重复
      path: "/",
      name: "Login",
      component: () => import("../views/Login.vue"),
    },
    {
      path: "/index",
      name: "index",
      component: () => import("../views/Index.vue"),
      children: [
        {
          path: "/about",
          name: "about",
          component: () => import("../views/AboutView.vue"),
        },
        {
          path: "/ceshigetlist",
          name: "ceshigetlist",
          component: () => import("../views/ceshiGetList.vue"),
        },
        {
          path: "/indexeach",
          name: "indexeach",
          component: () => import("../views/Indexeach.vue"),
        },
        {
          path: "/smart-dashboard",
          name: "smartDashboard",
          component: () => import("../views/SmartDashboard.vue"),
        },
        {
          path: "/coding-rule",
          name: "codingRule",
          component: () => import("../views/BmView.vue"),
        },
        {
          path: "/UserView",
          name: "UserView",
          component: () => import("../views/RBAC/UserView.vue"),
        },
        {
          path: "/RoleView",
          name: "RoleView",
          component: () => import("../views/RBAC/RoleView.vue"),
        },
        {
          path: "/JobView",
          name: "JobView",
          component: () => import("../views/RBAC/JobView.vue"),
        },
        {
          path: "/OrganView",
          name: "OrganView",
          component: () => import("../views/RBAC/OrganView.vue"),
        },
        {
          path: "/GetUserIdView",
          name: "GetUserIdView",
          component: () => import("../views/RBAC/GetUserIdView.vue"),
        },
        {
          path: "/Warehouselist",
          name: "Warehouselist",
          component: () => import("../views/Warehouse/Warehouselist.vue"),
        },
        {
          path: "/Reservoirlist",
          name: "Reservoirlist",
          component: () => import("../views/Warehouse/Reservoirlist.vue"),
        },
        {
          path: "/Seatlist",
          name: "Seatlist",
          component: () => import("../views/Warehouse/Seatlist.vue"),
        },
        {
          path: "/ProductList",
          name: "ProductList",
          component: () => import("../views/Product/ProductList.vue"),
        },
        {
          path: "/ProductAdd",
          name: "ProductAdd",
          component: () => import("../views/Product/ProductAdd.vue"),
        },
        {
          path: "/Material.GetList",
          name: "Material.GetList",
          component: () => import("../views/Material/Material.GetList.vue"),
        },
        {
          path: "/MaterialAdd",
          name: "MaterialAdd",
          component: () => import("../views/Material/MaterialAdd.vue"),
        },
        {
          path: "/ProductAdd",
          name: "ProductAdd",
          component: () => import("../views/Product/ProductAdd.vue"),
        },

        {
          path: "/Encasementlist",
          name: "Encasementlist",
          component: () =>
            import("../views/Warehouse/Encasement/Encasementlist.vue"),
        },
        {
          path: "/EncasementExecute",
          name: "EncasementExecute",
          component: () =>
            import("../views/Warehouse/Encasement/EncasementExecute.vue"),
        },
        {
          path: "/PurchaseInboundList",
          name: "PurchaseInboundList",
          component: () =>
            import(
              "../views/Warehouse/PurchaseInbound/PurchaseInboundList.vue"
            ),
        },
        {
          path: "/PurchaseInboundAdd",
          name: "PurchaseInboundAdd",
          component: () =>
            import("../views/Warehouse/PurchaseInbound/PurchaseInboundAdd.vue"),
        },
        {
          path: "/PickMaterialList",
          name: "PickMaterialList",
          component: () =>
            import("../views/Warehouse/PickMaterial/PickMaterialList.vue"),
        },
        {
          path: "/PickMaterialAdd",
          name: "PickMaterialAdd",
          component: () =>
            import("../views/Warehouse/PickMaterial/PickMaterialAdd.vue"),
        },
        {
          path: "/ReturnMaterialList",
          name: "ReturnMaterialList",
          component: () =>
            import("../views/Warehouse/ReturnMaterial/ReturnMaterialList.vue"),
        },
        {
          path: "/ReturnMaterialAdd",
          name: "ReturnMaterialAdd",
          component: () =>
            import("../views/Warehouse/ReturnMaterial/ReturnMaterialAdd.vue"),
        },
        {
          path: "/ProductStorageList",
          name: "ProductStorageList",
          component: () =>
            import("../views/Warehouse/TProductStorage/ProductStorageList.vue"),
        },
        {
          path: "/ProductStorageAdd",
          name: "ProductStorageAdd",
          component: () =>
            import("../views/Warehouse/TProductStorage/ProductStorageAdd.vue"),
        },
        {
          path: "/ProductStorageConfirm",
          name: "ProductStorageConfirm",
          component: () =>
            import(
              "../views/Warehouse/TProductStorage/ProductStorageConfirm.vue"
            ),
        },
        {
          path: "/SalesOutboundList",
          name: "SalesOutboundList",
          component: () =>
            import("../views/Warehouse/SalesOutbound/SalesOutboundList.vue"),
        },
        {
          path: "/SalesOutboundAdd",
          name: "SalesOutboundAdd",
          component: () =>
            import("../views/Warehouse/SalesOutbound/SalesOutboundAdd.vue"),
        },
        {
          path: "/ProductRecordList",
          name: "ProductRecordList",
          component: () =>
            import("../views/Warehouse/Record/ProductRecordList.vue"),
        },
        {
          path: "/ProductInventoryList",
          name: "ProductInventoryList",
          component: () =>
            import("../views/Warehouse/Record/ProductInventoryList.vue"),
        },
        {
          path: "/MaterialRecordList",
          name: "MaterialRecordList",
          component: () =>
            import("../views/Warehouse/Record/MaterialRecordList.vue"),
        },
        {
          path: "/MaterialInventoryList",
          name: "MaterialInventoryList",
          component: () =>
            import("../views/Warehouse/Record/MaterialInventoryList.vue"),
        },
        {
          path: "/SupplierReturnList",
          name: "SupplierReturnList",
          component: () =>
            import(
              "../views/Warehouse/TSupplier_returnsRead/SupplierReturnList.vue"
            ),
        },
        {
          path: "/SupplierReturnAdd",
          name: "SupplierReturnAdd",
          component: () =>
            import(
              "../views/Warehouse/TSupplier_returnsRead/SupplierReturnAdd.vue"
            ),
        },

        {
          path: "/CommonDefectList",
          name: "CommonDefectList",
          component: () => import("../views/Defect/CommonDefectList.vue"),
        },
        {
          path: "/DefectLevelList",
          name: "DefectLevelList",
          component: () => import("../views/Defect/DefectLevelList.vue"),
        },
        {
          path: "/DefectLocation",
          name: "DefectLocation",
          component: () => import("../views/Defect/DefectLocation.vue"),
        },
        {
          path: "/DefectTypeList",
          name: "DefectTypeList",
          component: () => import("../views/Defect/DefectTypeList.vue"),
        },
        {
          path: "/TestItemList",
          name: "TestItemList",
          component: () => import("../views/Detection/TestItemList.vue"),
        },
        {
          path: "/DetectionTypeList",
          name: "DetectionTypeList",
          component: () => import("../views/Detection/DetectionTypeList.vue"),
        },
        {
          path: "/DetectionToolList",
          name: "DetectionToolList",
          component: () => import("../views/Detection/DetectionToolList.vue"),
        },
        {
          path: "/DetectionPlanList",
          name: "DetectionPlanList",
          component: () => import("../views/Detection/DetectionPlanList.vue"),
        },
        {
          path: "/DetectionPlanAdd",
          name: "DetectionPlanAdd",
          component: () => import("../views/Detection/DetectionPlanAdd.vue"),
        },
        {
          path: "/IncomingInspectionList",
          name: "IncomingInspectionList",
          component: () =>
            import("../views/Detection/IncomingInspectionList.vue"),
        },
        {
          path: "/IncomingInspectionAdd",
          name: "IncomingInspectionAdd",
          component: () =>
            import("../views/Detection/IncomingInspectionAdd.vue"),
        },
        {
          path: "/ProductInspectionList",
          name: "ProductInspectionList",
          component: () =>
            import("../views/Detection/ProductInspectionList.vue"),
        },
        {
          path: "/ProductInspectionAdd",
          name: "ProductInspectionAdd",
          component: () =>
            import("../views/Detection/ProductInspectionAdd.vue"),
        },
        {
          path: "/WorkOrderInspectionList",
          name: "WorkOrderInspectionList",
          component: () => import("../views/Detection/WorkOrderInspectionList.vue"),
        },
        {
          path: "/WorkOrderInspectionAdd",
          name: "WorkOrderInspectionAdd",
          component: () => import("../views/Detection/WorkOrderInspectionAdd.vue"),
        },

        {
          path: "/BomList",
          name: "BomList",
          component: () => import("../views/Bom/BomList.vue"),
        },
        {
          path: "/BomAdd",
          name: "BomAdd",
          component: () => import("../views/Bom/BomAdd.vue"),
        },
        {
          path: "/Device_TypeView",
          name: "Device_TypeView",
          component: () =>
            import("../views/ADevice_Management/Device_TypeView.vue"),
        },
        {
          path: "/AEquipment_LedgerView",
          name: "AEquipment_LedgerView",
          component: () =>
            import("../views/ADevice_Management/AEquipment_LedgerView.vue"),
        },
        {
          path: "/AWorkshop_ManagementView",
          name: "AWorkshop_ManagementView",
          component: () =>
            import(
              "../views/AProduction_Management/AWorkshop_ManagementView.vue"
            ),
        },
        {
          path: "/AProduction_Line_ManagementShowView",
          name: "AProduction_Line_ManagementShowView",
          component: () =>
            import(
              "../views/AProduction_Management/AProduction_Line_ManagementShowView.vue"
            ),
        },
        {
          path: "/AProduction_PlanView",
          name: "AProduction_PlanView",
          component: () =>
            import(
              "../views/AProduction_Management/AProduction_Plan/AProduction_PlanView.vue"
            ),
        },
        {
          path: "/AProduction_PlanAdd",
          name: "AProduction_PlanAdd",
          component: () => import("../views/AProduction_Management/AProduction_Plan/AProduction_PlanAddView.vue"),
        },
        {
          path: "/AProcess_ManagementView",
          name: "AProcess_ManagementView",
          component: () =>
            import(
              "../views/AProduction_Management/AProcess_ManagementView.vue"
            ),
        },
        {
          path: "/AProcess_routeView",
          name: "AProcess_routeView",
          component: () =>
            import("../views/AProduction_Management/AProcess_routeView.vue"),
        },
        {
          path: "/AProcess_routeAddView",
          name: "AProcess_routeAddView",
          component: () =>
            import("../views/AProduction_Management/AProcess_routeAddView.vue"),
        },
        {
          path: "/AProduction_OrderView",
          name: "AProduction_OrderView",
          component: () =>
            import(
              "../views/AProduction_Management/AProduction_Work_Order/AProduction_OrderView.vue"
            ),
        },
        {
          path: "/WorkOrderSchedule",
          name: "WorkOrderSchedule",
          component: () =>
            import(
              "../views/AProduction_Management/AProduction_Work_Order/WorkOrderScheduleView.vue"
            ),
        },
        {
          path: "/WorkOrderDetail",
          name: "WorkOrderDetail",
          component: () =>
            import(
              "../views/AProduction_Management/AProduction_Work_Order/WorkOrderDetailView.vue"
            ),
        },
        {
          path: "/WorkOrderDispatch",
          name: "WorkOrderDispatch",
          component: () =>
            import(
              "../views/AProduction_Management/AWork_Order_Task/WorkOrderDispatchView.vue"
            ),
        },
        {
          path: "/TaskDetail",
          name: "TaskDetail",
          component: () =>
            import(
              "../views/AProduction_Management/AWork_Order_Task/TaskDetailView.vue"
            ),
        },
        {
          path: "/AWork_Order_TaskShowView",
          name: "AWork_Order_TaskShowView",
          component: () =>
            import(
              "../views/AProduction_Management/AWork_Order_Task/AWork_Order_TaskShowView.vue"
            ),
        },
        {
          path: "/AWork_Quality_InspectionView",
          name: "AWork_Quality_InspectionView",
          component: () =>
            import(
              "../views/AProduction_Management/AWork_Quality_Inspection/AWork_Quality_InspectionView.vue"
            ),
        },
        {
          path: "/AWork_ReportView",
          name: "AWork_ReportView",
          component: () =>
            import(
              "../views/AProduction_Management/AWork_Report/AWork_ReportView.vue"
            ),
        },
        {
          path: "/WorkReportDetail",
          name: "WorkReportDetail",
          component: () =>
            import(
              "../views/AProduction_Management/AWork_Report/WorkReportDetailView.vue"
            ),
        },
        {
          path: "/ASite_Management",
          name: "ASite_Management",
          component: () =>
            import(
              "../views/AProduction_Management/ASite_Management/ASite_ManagementView.vue"
            ),
        },
        {
          path: "/ASite_ManagementAddView",
          name: "ASite_ManagementAddView",
          component: () => import("../views/AProduction_Management/ASite_Management/ASite_ManagementAddView.vue"),
        },
        //工具管理模块
        {
          path: "/work_fixture",
          name: "work_fixture",
          component: () => import("../views/Appliance/work_fixture.vue"),
        },
        {
          path: "/work_fixtureseat",
          name: "work_fixtureseat",
          component: () => import("../views/Appliance/work_fixtureseat.vue"),
        },
        {
          path: "/work_fixturetype",
          name: "work_fixturetype",
          component: () => import("../views/Appliance/work_fixturetype.vue"),
        },
        {
          path: "/Toolborrowheaderlist",
          name: "Toolborrowheaderlist",
          component: () =>
            import("../views/Appliance/Tool/Toolborrowheaderlist.vue"),
        },
        {
          path: "/ToolborrowheaderAdd",
          name: "ToolborrowheaderAdd",
          component: () =>
            import("../views/Appliance/Tool/ToolborrowheaderAdd.vue"),
        },
        {
          path: "/Toolreturnorderlist",
          name: "Toolreturnorderlist",
          component: () =>
            import("../views/Appliance/Tool/Toolreturnorderlist.vue"),
        },
        {
          path: "/ToolreturnorderlistAdd",
          name: "ToolreturnorderlistAdd",
          component: () =>
            import("../views/Appliance/Tool/ToolreturnorderlistAdd.vue"),
        },
        {
          path: "/WoekingSchedule",
          name: "WoekingSchedule",
          component: () => import("../views/Working/WoekingSchedule.vue"),
        },
        {
          path: "/WorkingCalendarList",
          name: "WorkingCalendarList",
          component: () => import("../views/Working/WorkingCalendarList.vue"),
        },
        {
          path: "/WorkingciList",
          name: "WorkingciList",
          component: () => import("../views/Working/WorkingciList.vue"),
        },
        {
          path: "/WorkTeamList",
          name: "WorkTeamList",
          component: () => import("../views/Working/WorkTeamList.vue"),
        },
        {
          path: "/WorkTeamTypeList",
          name: "WorkTeamTypeList",
          component: () => import("../views/Working/WorkTeamTypeList.vue"),
        },
        {
          path: "/CustList",
          name: "CustList",
          component: () => import("../views/CustSupp/CustList.vue"),
        },
        {
          path: "/SupplierList",
          name: "SupplierList",
          component: () => import("../views/CustSupp/SupplierList.vue"),
        },
        {
          path: "/InforList",
          name: "InforList",
          component: () => import("../views/Mang/InforList.vue"),
        },
        {
          path: "/GetInfor",
          name: "GetInfor",
          component: () => import("../views/Mang/GetInfor.vue"),
        },
        {
          path: "/SmartDashboard",
          name: "SmartDashboard",
          component: () =>
            import("../views/SmartDashboard.vue"),
        },
      ],
    },
  ],
});

export default router;
